package com.zzyl.mapper;

import com.zzyl.dto.ResourceListDto;
import com.zzyl.dto.addResourceDto;
import com.zzyl.entity.Resource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ResourceMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Resource record);

    int insertSelective(Resource record);

    Resource selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Resource record);

    int updateByPrimaryKey(Resource record);

    /**
     * 这是Mybatis Generator拓展插件生成的方法(请勿删除).
     * This method corresponds to the database table sys_resource
     *
     * @mbg.generated
     * @author hewei
     */
    int batchInsert(@Param("list") java.util.List<Resource> list);

    List<Resource> getResourceList(ResourceListDto dto);

    List<Resource> getResourceTree(@Param("dataState") String dataState,
                                   @Param("resourceType") String resourceType,
                                   @Param("parentResourceNo") String parentResourceNo);

    Resource getMaxChildren(addResourceDto dto);

    List<Resource> getAllResourceById(Long userId);

    List<Resource> getMenuResourceByUserId(@Param("userId") Long userId,@Param("dataState") String dataState, @Param("resourceType")String resourceType);

    List<String> getAllResourceLabelByPath(@Param("publicAccessUrls") List<String> publicAccessUrls);
}